import Home from '../page/home'
import Login from '../page/login'

import Admin from '../page/home/admin'
import Role from '../page/home/role'
import User from '../page/home/user'
import Index from '../page/home/index/index'

import AdminList from '../page/home/admin/adminList'
import AdminQuery from '../page/home/admin/adminQuery'
import RoleList from '../page/home/role/roleList'
import RoleAdd from '../page/home/role/roleAdd'
import UserList from '../page/home/user/userList'
import UserAdd from '../page/home/user/userAdd'

const routes = [{
  path: '/home',
  name: 'home',
  title: '首页',
  component: Home,
  children: [{
    path: '/home/index',
    name: 'index',
    title:'首页',
    component: Index
  },{
    path: '/home/admin',
    name: 'admin',
    title: '管理员管理',
    component: Admin,
    children: [{
      path: '/home/admin/list',
      title: '管理列表',
      name: 'adminList',
      component: AdminList
    }, {
      path: '/home/admin/query',
      title: '管理查询',
      name: 'adminQuery',
      component: AdminQuery
    }]
  }, {
    path: '/home/role',
    name: 'role',
    title: '角色管理',
    component: Role,
    children: [{
      path: '/home/role/list',
      title: '角色列表',
      name: 'roleList',
      component: RoleList
    }, {
      path: '/home/role/add',
      title: '角色添加',
      name: 'roleAdd',
      component: RoleAdd
    }]
  },{
    path: '/home/user',
    name: 'user',
    title: '用户管理',
    component: User,
    children: [{
      path: '/home/user/list',
      title: '用户列表',
      name: 'userList',
      component: UserList
    }, {
      path: '/home/user/add',
      title: '用户添加',
      name: 'userAdd',
      component: UserAdd
    }]
  }]
}, {
  path: '/login',
  name: 'login',
  title: '登录',
  component: Login
}, {
  from: '/',
  to: '/login'
}]

export default routes